SRCC	= service.c thread.c conn.c timing.c logging.c msg.c http.c base.c cfg.c ../hidb/hidb.c

OBJS	= $(SRCC:.c=.o)
INCLUDE	= -I /usr/local/tokyotyrant/include -I /usr/local/tokyocabinet/include -I ../hidb/
LIBPATH	= -L /usr/local/tokyotyrant/lib
LIBFILE	= -levent -ltokyotyrant
CFLAGS	= -ggdb -Wall $(INCLUDE) $(LIBPATH) $(LIBFILE)

.c.o:
	@echo "              "
	@echo "C ..."
	$(CC) $(CFLAGS) -c $*.c -o $@

all: load 
load: $(OBJS)
	gcc -o loader loader.c $(OBJS) $(CFLAGS)
sel: $(OBJS)
	gcc -o selector selector.c $(OBJS) $(CFLAGS)
msg: msg.c msg.h
	gcc -o msg msg.c $(CFLAGS) -DMSG_MAIN
http: http.c http.h
	gcc -o http http.c $(CFLAGS) -DHTTP_MAIN
log: logging.c logging.h
	gcc -o logging logging.c $(CFLAGS) -DLOGGING_MAIN
clean:
	-rm $(OBJS)
rl:
	./loader
rs:
	./selector

